function LoginRequest(xhr, status, args) {
    if(args.validationFailed || !args.loggedIn) {
        jQuery('#dlgLogin').effect("shake", {
            times:3
        }, 100);
    } else {
        wgLogin.hide();
    }
    if (args.RegisterCodeSussecful) {
        wgRegister.hide();
        wgRegisterDetail.show();
    }
    if (args.RegisterEmployee) {
        wgRegisterDetail.hide();
        wgLogin.show();
    }
    if (args.selectMethodRecoverPassword == "Email") {
        wgLostPassword.hide();
        wgRecoverViaEmail.show();

    }else if (args.selectMethodRecoverPassword == "Answer") {
        wgLostPassword.hide();
        wgRecoverViaAnswer.show();
    }
    if (args.RecoverComplete || args.SetPasswordComplete) {
        wgRecoverViaEmail.hide();
        wgSetPassword.hide();
        wgLogin.show();
    }
    if (args.ShowFormSetPassword) {
        wgSetPassword.show();
        wgRecoverViaAnswer.hide();
    }
}

function UserBeansRequest(xhr, status, args) {
    if (args.edit){
        wgChangeProfile.hide();
        wgChangePassword.hide();
    }
}
function EmployeeManagementRequest(xhr, status, args) {
    if(!args.CreateGenerateCode) {
        wgCreateRegisterCode.hide();
    }
    if (args.edit){
        wgDetailsEmployee.hide();
    }
}

function RssManagementRequest(xhr, status, args) {
    if(args.create) {
        wgCreateRss.hide();
    }
    if (args.edit){
        wgEditRss.hide();
    }
}


function HospitalManagementRequest(xhr, status, args) {
    if(args.edit) {
        wgEditHospital.hide();
    }
    if(args.create) {
        wgCreateHospital.hide();
    }
}
function BankingManagementRequest(xhr, status, args) {
    if(args.edit) {
        wgEditBanking.hide();
    }
    if(args.create) {
        wgCreateBanking.hide();
    }
}
function JobManagementRequest(xhr, status, args){
    if(args.edit) {
        wgEditJob.hide();
    }
    if(args.create) {
        wgCreateJob.hide();
    }
}
function ClaimTypeManagementRequest(xhr, status, args){
    if(args.edit) {
        wgEditClaimType.hide();
    }
    if(args.create) {
        wgCreateClaimType.hide();
    }
}
function PaymentManagementRequest(xhr, status, args){
    if(args.edit) {
        wgEditPayment.hide();
    }
    if(args.create) {
        wgCreatePayment.hide();
    }
}

function CalimManagementRequest(xhr, status, args){
    if(args.edit) {
        wgEditCalim.hide();
    }
    if(args.create) {
        wgCreateCalim.hide();
    }
}
function FeedBackManagementRequest(xhr, status, args){
    if(args.edit) {
        wgEditFeedBack.hide();
    }
    if(args.create) {
        wgCreateFeedBack.hide();
    }
}

function CloseAllFrm(){
    wgCreateCalim.hide();
    wgViewBanking.hide();
    wgViewHospital.hide();
    wgViewPayment.hide();
    wgViewJob.hide();
    wgViewEmployee.hide();
    wgViewClaim.hide();
    wgViewClaimType.hide();
    wgViewFeedBack.hide();
    wgEditFeedBack.hide();  
    Contunie();
}

function Contunie(){
    wgCreateFeedBack.hide();
    wgCreatePayment.hide();
    wgEditPayment.hide();
    wgCreateClaimType.hide();
    wgEditClaimType.hide();
    wgCreateJob.hide();
    wgEditJob.hide();
    wgCreateBanking.hide();
    wgEditBanking.hide();
    wgCreateHospital.hide();
    wgEditHospital.hide();
    wgCreateRegisterCode.hide();
    wgMyProfile.hide();
}
